package top.huhuiyu.ds;

import java.util.Stack;
/**
 * 
 * @author Aiden Pearce
 *
 */
public class MyStackDemo {
  public static void main(String[] args) {
    MyStack<Integer> stack = new MyStack<>();
    System.out.println(stack.isEmpty());
    System.out.println(stack.size());
    stack.push(100);
    stack.push(200);
    System.out.println(stack.isEmpty());
    System.out.println(stack.size());
    System.out.println(stack.peek());
    
    System.out.println("===============================");
    while (!stack.isEmpty()) {
      System.out.println(stack.pop());
    }
    System.out.println("===============================");
    stack.push(100);
    stack.push(200);
    System.out.println(stack.pop());
    stack.push(300);
    System.out.println(stack.peek());
    System.out.println(stack.pop());
    System.out.println("系统的栈===============================");
    Stack<String> s = new Stack<>();
    s.push("小老弟");
    s.push("你怎么回事");
    System.out.println(s.pop());
    s.push("？");
    
    System.out.println(s.pop());
    System.out.println(s.peek());
  }
}
